-
Notifications
You must be signed in to change notification settings - Fork 150
refactor(io): replace universal_io with internal lightweight solution #237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Replaced the universal_io package with an internal implementation to reduce dependencies and improve efficiency. Added `io_helper.dart` and `io_web.dart` for handling platform-specific I/O operations. Updated `emoji_picker.dart` and `emoji_picker_internal_utils.dart` to use the new solution. Modified `pubspec.yaml` to remove universal_io.
@hm21 Thanks for your contribution and extremely sorry for late reply. I will try to catch up with recent issues an PR's soon. |
/// the hostname of the computer, the value of environment variables, | ||
/// the path to the running program, | ||
/// and other global properties of the program being run. | ||
class Platform { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it copied from somewhere? Can you add a reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Fintasys Yes, you’re right, it’s a super-minified version from universal_io
. I can add the reference directly in that file if you want, but wouldn’t it be better to create a NOTICES
file (similar to LICENSE
) and add the license from the universal_io
package there?
That way, the license is also included when a user opens the Flutter prebuilt license page, for example via showAboutDialog. Technically, you can also add it using the LicenseRegistry.addLicense
method, but personally, I prefer to create a NOTICES
file.
We could also do both, or just put it in the file header, whatever you prefer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems you are more familiar with this than me. I would say link in the file and entry in notice should be good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I’ve added the original license header to the file and created the NOTICE file as requested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes the external universal_io
dependency and replaces it with an internal lightweight solution to address WASM compatibility warnings on pub.dev and reduce external dependencies.
- Removes
universal_io
dependency from pubspec.yaml - Implements custom platform-specific I/O handling with conditional exports
- Updates import statements to use the new internal I/O helper
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
pubspec.yaml | Removes universal_io dependency |
lib/src/emoji_picker_internal_utils.dart | Updates import to use internal I/O helper |
lib/src/emoji_picker.dart | Updates import to use internal I/O helper |
lib/src/core/io/io_web.dart | Adds web-specific Platform implementation |
lib/src/core/io/io_helper.dart | Adds conditional export for platform-specific I/O |
NOTICES | Adds license attribution for derived code |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Description
This PR removes the dependency on
universal_io
and replaces it with an internal, lightweight implementation. This change helps reduce external dependencies while maintaining the same functionality.Additionally, this update resolves the WASM compatibility warning on pub.dev.
I encountered the same warning in my package, pro_image_editor, indicating that it is not WASM-compatible. This issue arises because my package depends on yours, which in turn depends on
universal_io
.Changes
io_helper.dart
andio_web.dart
to handle platform-specific I/O operations.emoji_picker.dart
andemoji_picker_internal_utils.dart
to use the new internal I/O solution.pubspec.yaml
to removeuniversal_io
.io_web.dart
, fixing the wasm compatibility issue.Why this change?
Testing
Checklist
Btw, thanks for creating this amazing package, it's really a Flutter gem!